package main

import (
	"time"

	"gindb/db"
)

func main() {
	db.InitRds("product")

	type User struct {
		Name     string
		Age      int
		Birthday time.Time
	}

	db.DB.AutoMigrate(&User{})

	user := User{Name: "Jinzhu", Age: 18, Birthday: time.Now()}

	db.DB.Create(&user)

	db.DB.Exec("create database If not exists product1 character set utf8mb4 collate utf8mb4_unicode_ci")
	db.DB.Exec("use product1")
	db.DB.AutoMigrate(&User{})
	db.DB.Create(&user)
}
